//
//  RecommendOfCommentTableViewCell.m
//  礼物
//
//  Created by dllo on 15/11/11.
//  Copyright © 2015年 liangsicheng. All rights reserved.
//

#import "RecommendOfCommentTableViewCell.h"

@implementation RecommendOfCommentTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}

-(void)createSubViews
{
    self.avatar_urlImageView=[[UIImageView alloc]initWithFrame:CGRectMake(10*WIDTH/375, 30*HEIGHT/667, 40*WIDTH/375, 40*HEIGHT/667)];
    [self.contentView addSubview:self.avatar_urlImageView];
    self.nicknameLabel=[[UILabel alloc]initWithFrame:CGRectMake(100*WIDTH/375, 10*HEIGHT/667, 200*WIDTH/375, 30*HEIGHT/667)];
    [self.contentView addSubview:self.nicknameLabel];
    self.contentLabel=[[UILabel alloc]initWithFrame:CGRectMake(100*WIDTH/375, 50*HEIGHT/667, 250*WIDTH/375, 40*HEIGHT/667)];
    [self.contentView addSubview:self.contentLabel];
    }

-(void)setModel:(RecommenDetailModel *)model
{
    _model=model;
    if (![_model.avatar_url isKindOfClass:[NSNull class]]) {
        [self.avatar_urlImageView sd_setImageWithURL:[NSURL URLWithString:_model.avatar_url]];
        
    }
    if ([_model.avatar_url isKindOfClass:[NSNull class]]) {
        self.avatar_urlImageView.image=[UIImage imageNamed:@"beij.png"];
        
    }
    self.contentLabel.text=_model.content;
    self.nicknameLabel.text=_model.nickname;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
